package cn.newjava.book.bean;

import java.io.Serializable;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.Email;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

/**
 * (User)实体类
 *
 * @author 陈华强
 * @since 2019-10-22 13:13:10
 */
@Data
public class User implements Serializable {
    private static final long serialVersionUID = 396525154344131416L;
    //用户id
    private Integer id;

    @NotBlank(message = "用户名不能为空")
    @Length(min = 1, max = 6, message = "用户名长度为1-6")
    private String username;

    @Length(min = 6,max = 20)
    private String password;

    @Email(message = "邮箱格式不正确")
    private String email;

}